package com.lsl.prototype_pattern;

/**
 * 原型模式
 *
 * @author Zed
 * @description
 * @date 2022/11/27 12:54
 */
public class Main {
    public static void main(String[] args) {
        Manager manager = new Manager();
        UnderLinePen upen = new UnderLinePen('~');
        MessageBox mBox = new MessageBox('*');
        MessageBox sBox = new MessageBox('/');
        manager.register("strong message", upen);
        manager.register("warning box", mBox);
        manager.register("slash box", sBox);

        Product p1 = manager.create("strong message");
        p1.use("Hello,world.");
        Product p2 = manager.create("warning box");
        p2.use("Hello,world.");
        Product p3 = manager.create("slash box");
        p3.use("Hello,world.");
    }
}
